<template>
	<view>
		<swiper autoplay indicator-dots indicator-color="white" interval="2000">
			<swiper-item v-for="item in banner" :key="item.id">
				<img :src="item.img_url" alt="" style="width: 100%;height: 100%;">
			</swiper-item>
		</swiper>
		<van-card :num="list.goods_number" :price="list.extra_price" :desc="list.goods_brief" :title="list.name"
			:thumb="list.list_pic_url" />
		<p v-html="list.goods_desc"></p>
		<van-goods-action>
			<van-goods-action-icon icon="chat-o" text="客服" dot />
			<van-goods-action-icon icon="cart-o" text="购物车" info="5" />
			<van-goods-action-icon icon="shop-o" text="店铺" />
			<van-goods-action-button text="加入购物车" type="warning" />
			<van-goods-action-button text="立即购买" />
		</van-goods-action>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				banner: [],
				list: {}
			}
		},
		methods: {
			async getBanner(id) {
				let {
					data: res
				} = await this.$http.get(
					'http://shop.bufantec.com/bufan/goods/detailaction?openId=13216484256&id=1009024?id=' + id)
				this.banner = res.gallery
				this.list = res.info
			}
		},
		onLoad(options) {
			this.getBanner(options.id)
		}
	}
</script>

<style lang="scss">
	img {
		width: 100% !important;
		height: 100% !important;
	}
</style>
